package cn.service.Impl;

import cn.dao.RoleDao;
import cn.domain.PageBean;
import cn.domain.Role;
import cn.service.RoleService;
import cn.utils.HQLHelper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by jiaxiang Huang on 2017/3/8.
 */
@Service
@Transactional
public class RoleServiceImpl implements RoleService {
    @Resource
    private RoleDao roleDao;
    @Override
    public List<Role> findAll() {
        return roleDao.findAll();
    }

    @Override
    public void delete(Long id) {
        roleDao.delete(id);
    }

    @Override
    public void add(Role role) {
        roleDao.save(role);
    }

    @Override
    public void update(Role role) {
        roleDao.update(role);
    }

    @Override
    public Role getById(Long id) {
        return roleDao.getById(id);
    }

    @Override
    public List<Role> getByIds(Long[] id) {
        return roleDao.getByIds(id);
    }

    @Override
    public PageBean getPageBean(HQLHelper hqlHelper, int currentPage) {
        return roleDao.getPageBean(hqlHelper,currentPage);
    }
}
